#!/bin/bash

# $Header: /opt/unixmon/tools/DNS/RCS/is_primaster,v 1.1 2012/11/27 07:50:51 yajin Exp $
# Author: yang.jin@ebay.com


export PATH=/bin:/usr/bin

DNS_SERVERS_LIST="/etc/named/IT_DNS_SERVERS"
RNDC="/opt/bind/sbin/rndc"

if [ ! -f $DNS_SERVERS_LIST ]; then
        echo -e "The configuration file \"$DNS_SERVERS_LIST\" does not exist."
        exit 2
fi

. $DNS_SERVERS_LIST


primary=$(echo $DNS_PRIMARY_MASTER | sed -e 's/[[:space:]]//g' -e 's/\..*//')

if [ "X$(hostname)" == "X${primary}" ]; then exit 0; else exit 1; fi

